function WFloat(name)
{
	this.name	= name;
	this.msg_button	= '';
	this.msg_init();
}
//进度条初始化
WFloat.prototype.msg_init = function() { 
	document.write("<div id='dProcess' class='dProcess' ><div id='dProcess_title' class='dProcess_title'></div><div id='dProcess_body' class='dProcess_body'></div><div id='dProcess_btn' class='dProcess_btn'></div></div>"); 
	document.write("<div id='dProcess_bg' class='dProcess_bg'></div>");
	var obj2 = this.getID("dProcess_bg");
	this.layerAlpha(obj2, 20);
}
WFloat.prototype.msg_onClose = function() {
	
}
//显示进度条
WFloat.prototype.msg_s = function (title, str, w, h, x, y) {
	var obj = this.getID("dProcess");
	var obj2 = this.getID("dProcess_bg");
	var obj_title = this.getID("dProcess_title");
	var obj_body = this.getID("dProcess_body");
	var obj_btn = this.getID("dProcess_btn");
	obj_title.innerHTML = title;
	obj_body.innerHTML = str;
	if(this.msg_button.length > 0){
		obj_btn.className = 'dProcess_btn';
		obj_btn.innerHTML = this.msg_button;
	}else {
		obj_btn.style.height = '0px';
	}

	var bodyWidth = this.scrollLeft() + this.bodyWidth();
	var bodyHeight = this.scrollTop() + this.bodyHeight();
	var width = this.get_width(obj);
	var height = this.get_height(obj);
	var offset_left = (bodyWidth  - width) / 2;

	var offset_top = (bodyHeight - height) / 2;

	if(parseInt(x) > 0)	obj.style.left = x + "px";
	else obj.style.left = offset_left + 'px';
	if(parseInt(y) > 0)	obj.style.top = y + "px";
	else obj.style.top = offset_top + 'px';
	if(parseInt(w) > 0)	obj.style.width = w + "px";
	if(parseInt(h) > 0)	obj.style.height = h + "px";

	obj.style.display = 'block';
	obj2.style.display = 'block';
	
}
//隐藏进度条
WFloat.prototype.msg_h = function() {
	var obj = this.getID("dProcess");
	var obj2 = this.getID("dProcess_bg");
	obj.style.display = 'none';
	obj2.style.display = 'none';
	this.msg_onClose();
}
//按钮
WFloat.prototype.msg_btn = function(t) {
	var html = '';
	this.msg_button = ""; 
	if(t.indexOf('ok') != -1)this.msg_button += "<input type=button class=button value=' 确定 ' onclick='" + this.name + ".msg_h()'>"; 
	if(t.indexOf('cancel') != -1)this.msg_button += "<input type=button class=button value=' 取消 ' onclick='" + this.name + ".msg_h()'>"; 
	if(t.indexOf('close') != -1)this.msg_button += "<input type=button class=button value=' 关闭 ' onclick='" + this.name + ".msg_h()'>"; 

	this.msg_button = "<div class='dProcess_line'>&nbsp;&nbsp;&nbsp;" + this.msg_button + "&nbsp;&nbsp;&nbsp;</div>";
}

WFloat.prototype.layerAlpha = function ( obj , alpha ){
	obj.style.filter = "alpha(opacity="+alpha+")"; /* IE用 */
	obj.style.mozOpacity = alpha / 100; /* FireFox用 */
	obj.style.opacity = alpha / 100; /* Safari用 */
}
WFloat.prototype.getID = function (obj)
{
	var element = null;
	if(document.getElementById)
	{
		element = document.getElementById(obj);
	}
	else if(document.all)
	{
		element = document.all[obj];
	}
	else if(document.layers)
	{
		element = document.layers[obj];
	} 
	return element;

} 

WFloat.prototype.fixE = function (e){
	if (typeof e == 'undefined') e = window.event;
	if (typeof e.layerX == 'undefined') e.layerX = e.offsetX;
	if (typeof e.layerY == 'undefined') e.layerY = e.offsetY;
	if (typeof e.srcElement == 'undefined') e.srcElement = e.target;
	return e;
}
WFloat.prototype.scrollTop = function (){
	var s; 
	if (typeof(window.pageYOffset) != 'undefined') { 
		s = window.pageYOffset; 
	} 
	else if (typeof(document.compatMode) != 'undefined' &&document.documentElement.scrollTop > 0) { 
		s = document.documentElement.scrollTop; 
	}  
	else if (typeof(document.body) != 'undefined') { 
		s = document.body.scrollTop; 
	} 
	
	return parseInt(s, 10);
}

WFloat.prototype.scrollLeft = function (){
	var s; 
	if (typeof(window.pageXOffset) != 'undefined') { 
		s = window.pageXOffset; 
	} 
	else if (typeof(document.compatMode) != 'undefined' &&document.documentElement.scrollLeft > 0) { 
		s = document.documentElement.scrollTop; 
	}
	else if (typeof(document.body) != 'undefined') { 
		s = document.body.scrollLeft; 
	} 
	return parseInt(s, 10);
}

WFloat.prototype.bodyWidth = function (){ 
	var w = 0;
	if (!document.all) {
		w = document.body.clientWidth > document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth;
	}
	else{
		w = document.documentElement.clientWidth == 0 ? document.body.clientWidth : document.documentElement.clientWidth;
	}
	return parseInt(w, 10);
	//return parseInt((document.all) ? document.body.clientWidth : window.innerWidth, 10);
}

WFloat.prototype.bodyHeight = function (){
	var h = 0;
	if (!document.all) {
		h = document.body.clientHeight > document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
	}
	else{
		h = document.documentElement.clientHeight == 0 ? document.body.clientHeight : document.documentElement.clientHeight;
	}
	return parseInt(h, 10);
	//return parseInt((document.all) ? document.body.clientHeight : window.innerHeight, 10);
}

WFloat.prototype.get_width = function (obj){
	var w = parseInt(obj.style.width, 10);
	if(!w && document.all){
		 w = parseInt(obj.offsetWidth, 10);
	}
	if(!w && document.all){
		 w = parseInt(obj.currentStyle.width, 10);
	} 
	if(!w){
		 w = 150;
	}
	return w;
}

WFloat.prototype.get_height = function (obj){
	var h = parseInt(obj.style.height, 10);
	if(!h && document.all){
		 h = parseInt(obj.offsetHeight, 10);
	} 
	if(!h && document.all){
		 h = parseInt(obj.currentStyle.height, 10);
	} 

	if(!h){
		 h = 280;
	}
	return h;
}

WFloat.prototype.get_left = function (obj) {
	return (obj.offsetParent==null ? obj.offsetLeft : obj.offsetLeft + this.get_left(obj.offsetParent));
}

WFloat.prototype.get_top = function (obj) {
	return (obj.offsetParent==null ? obj.offsetTop : obj.offsetTop + this.get_top(obj.offsetParent));
}